package com.longai.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * Moment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "moment", catalog = "longai")
public class Moment implements java.io.Serializable {

	// Fields

	private Integer momentId;
	private User user;
	private String momentContent;
	private Long momentPubtime;

	// Constructors

	/** default constructor */
	public Moment() {
	}

	/** full constructor */
	public Moment(User user, String momentContent, Long momentPubtime) {
		this.user = user;
		this.momentContent = momentContent;
		this.momentPubtime = momentPubtime;

	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "moment_id", unique = true, nullable = false)
	public Integer getMomentId() {
		return this.momentId;
	}

	public void setMomentId(Integer momentId) {
		this.momentId = momentId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "moment_content", length = 200)
	public String getMomentContent() {
		return this.momentContent;
	}

	public void setMomentContent(String momentContent) {
		this.momentContent = momentContent;
	}

	@Column(name = "moment_pubtime")
	public Long getMomentPubtime() {
		return this.momentPubtime;
	}

	public void setMomentPubtime(Long momentPubtime) {
		this.momentPubtime = momentPubtime;
	}


}